import service from "@/utils/request"

import SynchronizationLoginNork from '@/utils/SynchronizationLoginWork'
import Synchronization from "@/utils/Synchronization"
export interface BottomBinInstructionInterface {
    list: list[],
    total: number,
    stockTotal: number
}

export interface list{
    lotNo: string,
    partName: string,
    stockQty: number,
    moldNo: string,
    inShort: number,
    outShort: number,
    style: string,
    color: string,
    orderQty: number
}

export interface BottomOrderParameter {
    color:string,
    lotNo:string,
    moldNo:string,
    pageNum:number,
    pageSize:number,
    partName:string,
    style:string
}

export const BottomOrderDataAcquisition = (parms:BottomOrderParameter) => {
    return Synchronization.post<any,BottomBinInstructionInterface>(`/last/listLastStock`,parms)
}

// 号码明细参数
export interface NumberDetailParameter{
    lotNo:String
    partName:String
}

export interface NumberDetailInterface{
    inDetail:inDetail[]
    outDetail:outDetail[]
    sizes:sizes[]
}

export interface inDetail{
    deptName: string,
    slipDate: string,
    qty: number,
    operator: string
}

export interface outDetail{
    deptName: string,
    slipDate: string,
    qty: number,
    operator: string
}

export interface sizes{
    sizeNo: string,
    orderQty: number,
    inQty: number,
    mainShortQty: number,
    preShortQty: number,
    outQty: number,
    outShortQty: number,
    stockQty: number,
    cfmFlag: string,
    backgroundColor?:string

}

export const NumberDetailsDataInterface = (parms:NumberDetailParameter) => {
    return Synchronization.get<any,NumberDetailInterface>(`/last/getPcLastStockSizeDetail`,{
        params: {lotNo:parms.lotNo,partName:parms.partName}
    })
}

export const DropDownData = () => {
    return Synchronization.get<any,any>('/last/getLastStockCondition')
}